/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.webapp.reportObjects;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author ronald
 */
public class ReportMaterialRow {
    private List<Number> values;
    private Long id;
    private String materialName;
    private List<String> categories;
    private Number totalValue = 0;
    public ReportMaterialRow(Long id, String materialName) {
        this.id = id;
        this.materialName = materialName;
        values = new ArrayList<Number>();
        categories = new ArrayList<String>();

    }


    public List<String> getCategories() {
        return categories;
    }

    public void setCategories(List<String> categories) {
        this.categories = categories;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public List<Number> getValues() {
        return values;
    }

    public void setValues(List<Number> values) {
        this.values = values;
    }
    public void setCategory(String category){
        categories.add(category);
    }
    public void setValue(Number value){
        values.add(value);
    }

    public Number getTotalValue() {
        totalValue = 0;
        for(Number v: values){
            totalValue = totalValue.floatValue() + v.floatValue();
        }
        return totalValue;
    }

    public void setTotalValue(Number totalValue) {
        this.totalValue = totalValue;
    }

}
